<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<style>


</style>

<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
        <span aria-hidden="true">&times;</span></button>
    <h4 class="modal-title">经办人评价</h4>
</div>
<div class="modal-body">
        <form id="form_data">
            <table class="table table-hover table-striped table-bordered">
                <tr>
                    <th>序号</th>
                    <th>材料名称</th>
                    <th>序号</th>
                    <th>评价内容</th>
                    <th width="100px">评价记录</th>
                </tr>

                <input type="hidden" name="businessId" value="${businessInfo.id}">
                <c:set var="num" value="-1"/>
                <c:forEach items="${managerAssessTypeList}" varStatus="status1" var="i1">
                    <c:forEach items="${i1.value}" var="i2" varStatus="status2">
                        <tr>
                            <c:if test="${status2.index==0}">
                            <td rowspan="${ fn:length(i1.value)}">${status1.index+1}</td>
                            <td rowspan="${ fn:length(i1.value)}">${i1.key.name}</td>
                            </c:if>
                            <td>${status2.index+1}</td>
                            <td  style="text-align:left" >${i2.name}</td>
                            <td >
                                <c:set var="num" value="${num+1}"/>
                                <input type="hidden" name="managerAssessList[${num}].accessTypeId" value="${i2.id}">
                                    <select name="managerAssessList[${num}].result">
                                    <option value="-">-</option>
                                    <option selected value="Y" >Y</option>
                                    <option  value="N">N</option>
                                    </select>
                            </td>
                        </tr>
                    </c:forEach>
                </c:forEach>
                <tr>

                    <td  colspan="5" style="text-align: left">
                        说明：“评价记录”栏填写“Y”（通过），“N”（不通过），“-”（不适用）。
                    </td>

                </tr>
                <tr>

                    <td  colspan="5" style="text-align: center">
                        <button type="submit"
                                class="btn btn-default btn-success"><span
                                class="glyphicon glyphicon-ok"></span>&nbsp;确&nbsp;定&nbsp;
                        </button>
                    </td>

                </tr>

            </table>

        </form>

</div>

<script>
    <%--bootstrapValidator--%>
    var $form_data = $("#form_data");
    $form_data.bootstrapValidator({}).on('success.form.bv', function (e) {
        e.preventDefault();

        $.sysPlugin.superAjax({
            data: $form_data.serializeObject(),
            url: '${url}',
            operateType: '${operateType}',
            showSuccessAlert: true,
            showWarnAlert: true,
            successCall: function (data) {
                $.sysPlugin.successCallBack(data, {
                    modal: $("#modal_ajax"),
                    table: $("#table_data")
                })
            },
            errorCall: function (data) {
                $.sysPlugin.errorCallBack(data, {
                    form: $form_data
                })
            }, warnAlertCancelCall:function(){
                $form_data.data('bootstrapValidator').resetForm();
            }

        })


    });


    $.sysPlugin.initSimpleSelect2();
</script>
